package com.ly.loginstarter.biz;

import com.ly.loginstarter.dao.LoginDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class LoginBiz {

    @Resource
    private LoginDao loginDao;

    public Map<String, Object> login(String username, String password) {
        final List<Map<String, Object>> users = loginDao.selectForLogin(username, password);
        if (users.isEmpty()) {
            return null;
        } else {
            return users.get(0);
        }
    }
}
